package com.hq.ims.data.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.hq.mybatis.base.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Email 526666031@qq.com
 * @Detail 全局上传文件
 */
@Data
@Alias("FileRecord")
@TableName(value = "file_record")
@ApiModel(value = "项目文件记录")
public class FileRecord extends BaseModel<FileRecord> implements Serializable {

    @ApiModelProperty(value = "主键 - 不需程序员处理")
    @TableId(value = "`file_record_id`", type = IdType.ASSIGN_UUID)
    private String fileRecordId;

    @ApiModelProperty(value = "文件ID")
    @TableField(value = "`file_id`")
    private String fileId;

    @ApiModelProperty(value = "文件名称")
    @TableField(value = "`file_name`")
    private String fileName;

    @ApiModelProperty(value = "文件标记")
    @TableField(value = "`file_mark`")
    private String fileMark;

    @ApiModelProperty(value = "项目问路径")
    @TableField(value = "`file_url`")
    private String fileUrl;

    @ApiModelProperty(value = "所属表名")
    @TableField(value = "`own_table_name`")
    private String ownTableName;

    @ApiModelProperty(value = "所属表ID")
    @TableField(value = "`own_table_data_id`")
    private String ownTableDataId;

    @ApiModelProperty(value = "文件大小")
    @TableField(value = "`file_size`")
    private Long fileSize;

    @ApiModelProperty(value = "下载次数")
    @TableField(value = "`down_count`")
    private Integer downCount;

    @ApiModelProperty(value = "文件后缀")
    @TableField(value = "`file_suffix`")
    private String fileSuffix;

    @ApiModelProperty(value = "项目ID")
    @TableField(value = "`own_project_id`")
    private String ownProjectId;

    @ApiModelProperty(value = "项目名称")
    @TableField(value = "`own_project_name`")
    private String ownProjectName;

    @ApiModelProperty(value = "组织机构ID")
    @TableField(value = "`own_org_id`")
    private String ownOrgId;

    @ApiModelProperty(value = "组织机构名称")
    @TableField(value = "`own_org_name`")
    private String ownOrgName;

    @ApiModelProperty(value = "数据版本号")
    @TableField(value = "`version`")
    private Integer version;

    @ApiModelProperty(value = "创建用户ID")
    @TableField(value = "`create_user_id`", fill = FieldFill.INSERT)
    private String createUserId;

    @ApiModelProperty(value = "创建用户名称")
    @TableField(value = "`create_user_name`", fill = FieldFill.INSERT)
    private String createUserName;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "`create_date_time`", fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDateTime;

    @ApiModelProperty(value = "更新用户ID")
    @TableField(value = "`update_user_id`", fill = FieldFill.INSERT_UPDATE)
    private String updateUserId;

    @ApiModelProperty(value = "更新用户ID")
    @TableField(value = "`update_user_name`", fill = FieldFill.INSERT_UPDATE)
    private String updateUserName;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "`update_date_time`", fill = FieldFill.INSERT_UPDATE)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDateTime;

    @ApiModelProperty(value = "是否删除")
    @TableField(value = "`is_del`")
    private Boolean isDel;
}
